<?php
require_once('../../conf/config.php.inc');
require_once(SYBMAS_LIB_PATH.'/liblogin.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/layout.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybmas.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/menu.php.inc');
require_once('libtablas.php.inc');
verificar_inicio_sesion();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/sybmasstyle.css">
<script src="<?php echo LAYOUT_URI?>/jquery-1.2.1.min.js"
	type="text/javascript"></script>
<script src="<?php echo LAYOUT_URI?>/menu-collapsed.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/style.css" />
<link rel="stylesheet" type="text/css"
	href="<?php echo JAVASCRIPT_URI?>/tabs/tabs.css">
<script src="<?php echo JAVASCRIPT_URI?>/tabs/tabs.js"
	type="text/javascript"></script>
<script type="text/javascript" src="<?php echo JAVASCRIPT_URI?>/commons.js"></script>
<script src="<?php echo JAVASCRIPT_URI?>/validacionFormularios.js"
	type="text/javascript"></script>
<script type="text/javascript" src="agregar.js"></script>
<title>.:: Sybmas - Bloquear o Desbloquear Login</title>
<!--[if lt IE 8]>
   <style type="text/css">
   li a {display:inline-block;}
   li a {display:block;}
   </style>
   <![endif]-->
</head>
<body onunload="closeDialog()">
<script src="<?php echo JAVASCRIPT_URI?>/tooltip/wz_tooltip.js"
	type="text/javascript"></script>


<br>
<div id="dialog">
<div class="title">Bloquear o Desbloquear Login</div>


<?php 
$id=$_GET['suid'];
$sybuser_connection=start_default_sybuser_connection();
$query="SELECT suid,name, ".
       "CASE status WHEN 2 THEN 'Bloqueado' ".
   	   "ELSE 'Desbloqueado' ".
   	   "END AS status ".
   	   "FROM master..syslogins ".
	   "WHERE suid=$id "; 	
$result=sybase_query($query,$sybuser_connection);
$data=sybase_fetch_array($result);

$unlockname=$data['name'];
$estatus=$data['status'];
?>

<form action="desbloq2.php" method="POST" target="dialog" 
	onsubmit="return verificarFormulario()">
<input type="hidden" value="<?php echo $unlockname?>" name="name"></input> 
<h2>Seleccione la accion que desea realizar:</h2>

<table width="80%" border="1">
	<tbody>
		<tr>
			<th>Bloquear o Desbloquear Login</th>
			<td>
				<input type="radio" name="lock" id="lock" value="lock" <?php echo $estatus=='Bloqueado'?' checked="checked" ':'' ?>></input>Bloquear (lock)
				<input type="radio" name="lock" id="unlock"  value="unlock" <?php echo $estatus=='Desbloqueado'?' checked="checked" ':'' ?>></input>Desbloquear (unlock)
			</td>									   			
		</tr>
		<tr>
			<th>Login</th>
			<td><?php echo $unlockname?></td>			
		</tr>
		<tr>
			<th>Status</th>
			<td><?php echo $estatus?></td>
		</tr>		
</tbody>
</table>
<hr/>
<input type="submit" value="Continuar">
<input type="button" value="Cancelar" onclick="window.close()">
</form>
</div>

</body>
</html>		